fix empty messages dont get logged (modal interaction responses) - #3607
Closed
Egemenbdk wants to merge 3 commits into
Closed
fix empty messages dont get logged (modal interaction responses)#3607Egemenbdk wants to merge 3 commits into
Egemenbdk wants to merge 3 commits into
Conversation
jamesbt365
reviewed
Aug 14, 2025
Comment on lines
+262
to
+265
| if (!msg.content || msg.content.trim() === "") { | ||
| cache = cache.remove(id); | ||
| return; | ||
| } |
Contributor
There was a problem hiding this comment.
I don't like this? Messages without content but have embeds, attachments, components (esp CV2), polls, message snapshots, nested interaction data or any other future field will be ignored because content will be empty.
There must be a better way you can handle this.
Author
There was a problem hiding this comment.
I'll add a check to make sure it was a slash command that directly returned a modal
Contributor
There was a problem hiding this comment.
See if message.state is SENDING on these modal spawns and if it is check if its a bot or from an interaction, if it does then you should be able to reliably go off that.
Hardcoding this is not future proof at all and should be avoided, especially over something so minor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a slash command directly returns a modal, for example:
interaction.response.send_modal(), the slash command will get logged as a deleted message even though no message was sent and since its contentless, it overlaps with other elements shown below and doesn't appear right, this 4 line update will stop logging contentless messages which are only possible if a slash command returns a modal.edit: fixed my grammar its 5 am